using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using THSLib;
using THSERP.BaseProvider;
using System.Data;
using THSERP.BusinessEntities;
using System.Drawing;

namespace THSERP.Modules.Report
{
    public partial class ICRP012InventoryStocksGridControl : THSGridControl
    {
       

        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            gridView.OptionsView.ShowFooter = true;
            gridView.OptionsBehavior.Editable = false;
            gridView.OptionsCustomization.AllowFilter = true;
            gridView.OptionsView.ShowAutoFilterRow = true;
            gridView.RowCellStyle+=new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(gridView_RowCellStyle);
            return gridView;
        }

    void  gridView_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
    {
 	    try
                    {
                     if(e.RowHandle>=0)
                     {
                        DevExpress.XtraGrid.Views.Grid.GridView gridView = (DevExpress.XtraGrid.Views.Grid.GridView)sender;
                        ICInventoryStocksInfo objICInventoryStocksInfo = (ICInventoryStocksInfo)gridView.GetRow(e.RowHandle);
                        if (objICInventoryStocksInfo != null)
                        {
                            if (objICInventoryStocksInfo.ICInventoryStockQuantity<=0)
                            {
                                e.Appearance.BackColor2 = Color.Salmon;
                                //e.Appearance.BackColor2 = Color.Red;
                            }
                            else 
                            {
                               // e.Appearance.BackColor = Color.Salmon;
                                e.Appearance.BackColor2 = Color.WhiteSmoke;

                            }
                           
                        }
                    }
                 }
                catch (Exception ex)
                {

                }
    }
        
    }
}
